test: prefer in-memory databases in sqlite tests - #64701
Conversation
|
Review requested:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #64701 +/- ##
==========================================
+ Coverage 90.14% 90.27% +0.13%
==========================================
Files 741 762 +21
Lines 242194 247534 +5340
Branches 45606 46693 +1087
==========================================
+ Hits 218323 223466 +5143
- Misses 15358 15492 +134
- Partials 8513 8576 +63 🚀 New features to boost your workflow:
|
araujogui
left a comment
There was a problem hiding this comment.
I believe we can extend the pattern to more test files
|
The only tests that need temporary files are DatabaseSync() constructor, open(), and backup(). |
|
Done, extended it per your guidance. Converted the named-parameter and statement suites plus the throwaway databases in the main test file to I kept files in a few places beyond the constructor/open/backup cases where an on-disk or shared database is actually required: the timeout suite and the cross-worker changeset test (both share a database by path), and the |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Commit Queue failed- Loading data for nodejs/node/pull/64701 ✔ Done loading data for nodejs/node/pull/64701 ----------------------------------- PR info ------------------------------------ Title test: prefer in-memory databases in sqlite tests (#64701) ⚠ Could not retrieve the email or name of the PR author's from user's GitHub profile! Branch bitpshr:test/sqlite-prefer-in-memory -> nodejs:main Labels test, author ready, needs-ci, sqlite Commits 2 - test: prefer in-memory databases in sqlite tests - test: convert more sqlite tests to in-memory Committers 1 - Paul Bouchon <mail@bitpshr.net> PR-URL: https://github.com/nodejs/node/pull/64701 Refs: https://github.com/nodejs/node/issues/64665 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com> ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/64701 Refs: https://github.com/nodejs/node/issues/64665 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com> -------------------------------------------------------------------------------- ℹ This PR was created on Thu, 23 Jul 2026 18:18:41 GMT ✔ Approvals: 2 ✔ - Matteo Collina (@mcollina) (TSC): https://github.com/nodejs/node/pull/64701#pullrequestreview-4781269372 ✔ - Edy Silva (@geeksilva97): https://github.com/nodejs/node/pull/64701#pullrequestreview-4782351068 ✔ Last GitHub CI successful ℹ Last Full PR CI on 2026-08-03T06:14:32Z: https://ci.nodejs.org/job/node-test-pull-request/75411/ - Querying data for job/node-test-pull-request/75411/ ✔ Build data downloaded ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ No git cherry-pick in progress ✔ No git am in progress ✔ No git rebase in progress -------------------------------------------------------------------------------- - Bringing origin/main up to date... From https://github.com/nodejs/node * branch main -> FETCH_HEAD ✔ origin/main is now up-to-date - Downloading patch for 64701 From https://github.com/nodejs/node * branch refs/pull/64701/merge -> FETCH_HEAD ✔ Fetched commits as 7e439828de88..a2aed4d77d9e -------------------------------------------------------------------------------- [main 78f07cc15c] test: prefer in-memory databases in sqlite tests Author: Paul Bouchon <mail@bitpshr.net> Date: Thu Jul 23 14:10:32 2026 -0400 3 files changed, 8 insertions(+), 35 deletions(-) [main d90a2cdd97] test: convert more sqlite tests to in-memory Author: Paul Bouchon <mail@bitpshr.net> Date: Fri Jul 24 14:26:03 2026 -0400 3 files changed, 46 insertions(+), 63 deletions(-) ✔ Patches applied There are 2 commits in the PR. Attempting autorebase. (node:374) [DEP0190] DeprecationWarning: Passing args to a child process with shell option true can lead to security vulnerabilities, as the arguments are not escaped, only concatenated. (Use `node --trace-deprecation ...` to show where the warning was created) Rebasing (2/4) Executing: git node land --amend --yes ⚠ Found Refs: https://github.com/nodejs/node/issues/64665, skipping.. --------------------------------- New Message ---------------------------------- test: prefer in-memory databases in sqlite testshttps://github.com/nodejs/node/actions/runs/30799387850 |
Several SQLite tests created temporary file databases through a `nextDb()` helper even though they only exercise SQL behavior and never rely on filesystem persistence. Switch those to `:memory:`, which is faster and drops the temporary-file bookkeeping. Tests that depend on an on-disk or shared database keep using files: the constructor, open() and backup() cases, the timeout and cross-worker suites, and the WAL journal-mode PRAGMA. Refs: nodejs#64665 Signed-off-by: Paul Bouchon <mail@bitpshr.net>
a2aed4d to
3a2863c
Compare
|
Squashed into a single commit, so the earlier commit-queue "squash or rebase" ambiguity is resolved. Should be good to re-queue whenever. |
Refs #64665. Converts the SQLite tests that only exercise SQL behavior (transactions, data types, typed-array/data-view binding) from temporary file databases to
:memory:, which is faster and drops thenextDb()temp-file bookkeeping.Tests that verify on-disk behavior (timeout, database-sync) intentionally keep using files. This is a focused first pass; the mixed-usage files (named-parameters, statement-sync) could follow.
Refs: #64665
cc @araujogui, let me know if this is what you had in mind, happy to extend it to the remaining files.